package com.fenghongzhang.day005;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

import com.scwang.smart.refresh.header.BezierRadarHeader;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import com.scwang.smart.refresh.layout.api.RefreshLayout;
import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener;
import com.scwang.smart.refresh.layout.listener.OnRefreshListener;

public class Main4Activity extends AppCompatActivity {
    private SmartRefreshLayout smart;
    private BezierRadarHeader hear;
    private RecyclerView rv;
    private static final String TAG = "Main4Activity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4);
        
        smart = (SmartRefreshLayout) findViewById(R.id.smart);
        hear = (BezierRadarHeader) findViewById(R.id.hear);
        rv = (RecyclerView) findViewById(R.id.rv);
        
        smart.setOnRefreshListener(new OnRefreshListener() {
            @Override
            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
                Log.i(TAG, "onRefresh: ");
                refreshLayout.finishRefresh();
            }
        });
        
        smart.setOnLoadMoreListener(new OnLoadMoreListener() {
            @Override
            public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
                Log.i(TAG, "onLoadMore: ");
                refreshLayout.finishLoadMore();
            }
        });

    }
}
